$(function () {
    $('#username').change(function () {
        var username = $(this).val();
        $.get(path+'/UserServlet',{method:"isHave",name:username}, function (data) {
            ui = data.message;
            console.log(ui);
           $.each(data,function (i,n) {
               if(n.code==1)
               {
                   $('#sapnnew').text("已经有了");
               }else
               {
                   $('#sapnnew').text("可以注册");
               }

           })
        },"json")
    })
})